<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:nyext="urn:noury-extensions" exclude-result-prefixes="xsl nyext msxsl">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:param name="package" />
  <xsl:param name="assembly" />
  <xsl:param name="outdir" />
  <xsl:param name="domainName" />
  <xsl:variable name="domain" select="/manifest/types/domain[@name=$domainName]" />

  <xsl:include href="functions.xslt" />
  
  <xsl:template name="get-datasource-src">
  <xsl:comment>
    <xsl:text>
    This file is automatically generated by Visual Studio .Net. It is 
    used to store generic object data source configuration information.  
    Renaming the file extension or editing the content of this file may   
    cause the file to be unrecognizable by the program.
  </xsl:text>
  </xsl:comment>
<GenericObjectDataSource DisplayName="{$domain/@name}" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
   <TypeInfo>
   <xsl:value-of select="$package" />
   <xsl:text>.</xsl:text>
   <xsl:value-of select="$domain/@name" />
   <xsl:text>, </xsl:text>
   <xsl:value-of select="$assembly" />
   <xsl:text>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=493dc35e39334ebe</xsl:text>
   </TypeInfo>
</GenericObjectDataSource>
  </xsl:template>

  <xsl:template name="generate-user-file">
    <xsl:variable name="src">
      <xsl:call-template name="get-datasource-src" />
    </xsl:variable>
    <xsl:copy-of select="$src" />
  </xsl:template>

  <xsl:template match="/">
    <xsl:call-template name="generate-user-file" />
  </xsl:template>
</xsl:stylesheet>
